﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QldtSdh.Utils
{
    class LogUtil
    {
        public static void Log(string tag, string content)
        {
            if (!Directory.Exists(Application.StartupPath + "\\Log"))
                Directory.CreateDirectory(Application.StartupPath + "\\Log");
            using (var fs = new StreamWriter(string.Format("{0}\\log{1}{2}{3}.txt", Application.StartupPath + "\\Log", DateTime.Now.Date.Year, DateTime.Now.Date.Month, DateTime.Now.Date.Day), true))
            {
                fs.WriteLine(tag + ": " + content + " - " + DateTime.Now.ToString());
                fs.Close();
            }
        }
    }
}
